home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gwuada_4.zip / SCRIPT.DOC < prev   
Text File  |  1990-07-25  |  4KB  |  97 lines

  1.  
  2.  
  3.     SCRIPT Version 1.1 - Save console output to a file
  4.  
  5. I hereby release this program into the public domain. Do with
  6. it as you please. I would appreciate it if my name were left
  7. in the source code somewhere.
  8.  
  9. DISCLAIMER:
  10.  
  11.     I have had no problems with this program to date, but I have
  12. no doubt that there are TSR's and other beasties lurking out there that
  13. will interact in weird and wonderful ways with this program.
  14. I accept no responsibility for any trashed FAT's or otherwise,
  15. that might result from a war of the above sort. I have tested the
  16. program only under MS-DOS 3.2.
  17.  
  18. WHAT IT DOES:
  19.  
  20.     SCRIPT is similar to the UNIX program of the same name.
  21. While running SCRIPT, output that appears on the console,
  22. will also be saved into a file for later perusal.
  23.  
  24. USAGE:
  25.  
  26.     SCRIPT is called from the DOS command line thusly:
  27.  
  28.     "script [-f outputfile] [-a] [command]"
  29.  
  30.     Output is saved into the file "outputfile" if is given. Default
  31. is the file "typescript" in the current directory. If the "-a"
  32. option is given, SCRIPT appends to "outputfile" rather than
  33. truncating it first.
  34.  
  35.     SCRIPT optionally takes a command as argument. If one is given,
  36. this command is executed rather than a copy of "command.com". If
  37. "command" is a command.com builtin, it must be given as argument to
  38. "command /c". An example usage is:
  39.  
  40.     script -f junk command /c echo hello world
  41.  
  42. SCRIPT terminates when the command running under it terminates.
  43.  
  44. PROGRAM OPERATION:
  45.  
  46.     SCRIPT works by intercepting the DOS function call interrupt
  47. "int 21". When a program running under SCRIPT executes an "int 21",
  48. SCRIPT examines the DOS function call to determine whether it will
  49. result in output going to the console. If such is the case, SCRIPT
  50. will save this output in an internal buffer and pass the call on to
  51. the real DOS so that it does the actual console output. When the
  52. internal buffer is full, SCRIPT flushes it to disk. To do this,
  53. SCRIPT uses the undocumented DOS function call 50h - SETPSP.
  54. I have no idea which versions of DOS support this function call.
  55.  
  56. NOTES:
  57.  
  58.    SCRIPT keeps the output file open throughout it's entire operation.
  59. If a chkdsk is run while SCRIPT is active, it may report lost clusters
  60. and other such things. Do not reclaim these clusters; they probably
  61. belong the SCRIPT's output file.
  62.  
  63.    Do not install any TSR's while running script.
  64.    
  65.    Do not forget that script is running. If you do, you may run out
  66. of disk space fairly quickly. You can tell whether script is active
  67. by trying to run it again. If it was active, the new invocation
  68. will abort with an error message.
  69.  
  70. BUGS:
  71.  
  72.     On output, SCRIPT first writes all the data to the output
  73. file, and then chains to DOS so that DOS does the actual console
  74. output. If a ^C is hit while this console output is taking place,
  75. console output is stopped. However this data has already been
  76. written to the output file. The result is that more data can appear
  77. in the output file than actually appeared on the screen.
  78.  
  79.     If a ^C is typed while a program running under SCRIPT is waiting
  80. for input, SCRIPT can become confused and may stop saving output
  81. to the output file. See the source code for an explanation of this
  82. phenomenon.
  83.  
  84.     If a program outputs to the console by calling the BIOS,
  85. or by writing directly to the hardware, this output will not
  86. be saved in the output file. There are probably even ways of
  87. doing output through DOS that SCRIPT does not handle properly.
  88.  
  89. COMPILING:
  90.  
  91.     SCRIPT was written using Turbo C version 2.0 and TASM 1.0.
  92.     A makefile is provided, although it may not work with Borlands
  93.     make program.
  94.  
  95. Suggestions and Bug reports will be much appreciated.
  96. graham@sce.carleton.ca (Doug Graham)
  97.